<template>
    <el-container>
        <el-header>HIS</el-header>
        <el-container>
            <el-aside width="400px">
                <el-row class="tac">
                    <el-col :span="12">
                        <h5>菜单</h5>
                        <el-menu
                                default-active="2"
                                class="el-menu-vertical-demo"
                                @open="handleOpen"
                                @close="handleClose"
                                @select="hendleselect"
                        >
                            <el-submenu index="1">
                                <template slot="title">
                                    <i class="el-icon-location"></i>
                                    <span>挂号收费</span>
                                </template>
                                <el-menu-item index="1-1">
                                    <template slot="title">现场挂号</template>
                                </el-menu-item>

                                <el-menu-item index="1-2">
                                    <template slot="title">收费</template>
                                </el-menu-item>
                            </el-submenu>
                            <el-submenu index="2">
                                <template slot="title">
                                    <i class="el-icon-location"></i>
                                    <span>基础信息维护</span>
                                </template>
                                <el-menu-item index="2-1" >
                                    <template slot="title">科室管理</template>
                                </el-menu-item>
                                <el-menu-item index="2-2" >
                                    <template slot="title">非药品项目收费管理</template>
                                </el-menu-item>
                            </el-submenu>
                        </el-menu>
                    </el-col>
                </el-row>
            </el-aside>
            <el-main>
                <router-view></router-view>
            </el-main>
        </el-container>
    </el-container>
</template>

<script>
    export default {
        name: "home",
        methods:{
            handleOpen(key, keyPath) {
                console.log(key, keyPath);
            },
            handleClose(key, keyPath) {
                console.log(key, keyPath);
            },
            hendleselect(index){
                console.log(index)
                if (index == "2-1"){
                    this.$router.push('/dept');
                }
                if (index == "2-2"){
                    this.$router.push(('/fmed'))
                }
            }
        }
    }
</script>

<style scoped>

</style>